package cn.wolfcode.wechat.controller;

import cn.wolfcode.wechat.util.JSONResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LoginController {
    /**
     * 后台管理页面登陆界面
     * @param username
     * @param password
     * @return
     */
    @RequestMapping("mgrLogin")
    @ResponseBody
    public JSONResult lgoin(String username,String password){
        if (!"admin".equals(username)){
            return new JSONResult(false,"用户名不存在");
        }else if (!"admin".equals(password)){
            return new JSONResult(false,"密码错误");
        }
        return new JSONResult();
    }

    @RequestMapping("index")
    public String index(){
        return "index";
    }
}
